package com.huike.common.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huike.common.core.domain.MPModel.MPBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 线索
 * </p>
 *
 * @author author
 * @since 2023-08-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_clue")
@ApiModel(value="TbClue对象", description="线索")
public class MPTbClue extends MPBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "线索id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "客户姓名")
    private String name;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "渠道")
    private String channel;

    @ApiModelProperty(value = "活动id")
    private Long activityId;

    @ApiModelProperty(value = "1 男 0 女")
    private String sex;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "微信")
    private String weixin;

    @ApiModelProperty(value = "qq")
    private String qq;

    @ApiModelProperty(value = "意向等级")
    private String level;

    @ApiModelProperty(value = "意向学科")
    private String subject;

    @ApiModelProperty(value = "状态(已分配1  进行中2  回收3  伪线索4)")
    private String status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建人")
    @TableField(select = false)
    private String createBy;

    @ApiModelProperty(value = "伪线索失败次数(最大数3次)")
    private Integer falseCount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime nextTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "是否转派")
    private String transfer;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = "线索失效时间")
    private LocalDateTime endTime;

    /** 所属人 */
    @ApiModelProperty(value = "所属人")
    private String owner;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = "所属人时间")
    private LocalDateTime ownerTime;

    @ApiModelProperty(value = "活动简介")
    private String activityInfo;


    @ApiModelProperty(value = "活动名称")
    private String activityName;

    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @ApiModelProperty(value = "创建人id")
    private Long userId;


    public enum StatusType{


        UNFOLLOWED("待跟进","1"),
        FOLLOWING("跟进中","2"),
        RECOVERY("回收","3"),
        FALSE("伪线索/踢回公海","4"),
        DELETED("删除","5"),
        TOBUSINESS("转换商机","6"),
        TOCUSTOMER("转换客户","7");

        private String name;
        private String value;

        private StatusType(String name,String value)
        {
            this.name = name;
            this.value = value;
        }

        public String getName() {
            return name;
        }

        public String getValue() {
            return value;
        }
    }

    public enum ImportDictType
    {

        CHANNEL("渠道来源","clues_item"),

        SUBJECT("意向学科","course_subject"),

        LEVEL("意向学科","clues_level"),

        SEX("性别","sys_user_sex");


        private String name;
        private String dictType;

        private ImportDictType(String name, String dictType)
        {
            this.name = name;
            this.dictType = dictType;
        }

        public String getName() {
            return name;
        }

        public String getDictType() {
            return dictType;
        }
    }

}
